package com.nbsaas.boot.common.rest.resource;

import com.nbsaas.boot.common.api.apis.IpVisitChannelApi;
import com.nbsaas.boot.common.data.entity.IpVisitChannel;
import com.nbsaas.boot.common.api.domain.request.IpVisitChannelRequest;
import com.nbsaas.boot.common.api.domain.response.IpVisitChannelResponse;
import com.nbsaas.boot.common.api.domain.simple.IpVisitChannelSimple;
import com.nbsaas.boot.common.rest.convert.IpVisitChannelSimpleConvert;
import com.nbsaas.boot.common.rest.convert.IpVisitChannelEntityConvert;
import com.nbsaas.boot.common.rest.convert.IpVisitChannelResponseConvert;
import com.nbsaas.boot.common.data.repository.IpVisitChannelRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   -业务接口实现
*/
@Transactional
@Service
public class IpVisitChannelResource extends BaseResource<IpVisitChannel,IpVisitChannelResponse, IpVisitChannelSimple, IpVisitChannelRequest>  implements IpVisitChannelApi {

    @Resource
    private IpVisitChannelRepository ipVisitChannelRepository;

    @Override
    public JpaRepositoryImplementation<IpVisitChannel, Serializable> getJpaRepository() {
        return ipVisitChannelRepository;
    }

    @Override
    public Function<IpVisitChannel, IpVisitChannelSimple> getConvertSimple() {
        return new IpVisitChannelSimpleConvert();
    }

    @Override
    public Function<IpVisitChannelRequest, IpVisitChannel> getConvertForm() {
        return new IpVisitChannelEntityConvert();
    }

    @Override
    public Function<IpVisitChannel, IpVisitChannelResponse> getConvertResponse() {
        return new IpVisitChannelResponseConvert();
    }




}


